% -*-latex-*-
%% /u/sy/beebe/tex/bib/showtags.sty, Tue Jul 10 17:05:19 1990
%% Edit by Nelson H.F. Beebe <beebe@plot79.math.utah.edu>
%%
%% =====================================================================
%%  @LaTeX-style-file{
%%      author          = "Nelson H. F. Beebe",
%%      version         = "1.02",
%%      date            = "10 September 1991",
%%      filename        = "showtags.sty",
%%      address         = "Center for Scientific Computing
%%                         and Department of Mathematics
%%                         South Physics Building
%%                         University of Utah
%%                         Salt Lake City, UT 84112
%%                         USA
%%                         Tel: (801) 581-5254",
%%      checksum        = "32413 73 351 3276",
%%      email           = "beebe@science.utah.edu (Internet)",
%%      codetable       = "ISO/ASCII",
%%      supported       = "yes",
%%      docstring       = "This style file causes the bibliography
%%                         cite tags to be displayed in boldface
%%                         text in a right-adjusted framed box over
%%                         each entry in a bibliography.  This serves
%%                         as a handy reference when the tags are
%%                         needed for a \cite{} macro.
%%
%%                         For flexibility, the user may redefine
%%                         \thecitetag to change the format. E.g.
%%                         \renewcommand{\thecitetag}[#1]{\fbox{\small\tt #1}}
%%                         would typeset the tag in small typewriter
%%                         text in a box.
%%
%%                         The checksum field above contains a CRC-16
%%                         checksum as the first value, followed by the
%%                         equivalent of the standard UNIX wc (word
%%                         count) utility output of lines, words, and
%%                         characters.  This is produced by Robert
%%                         Solovay's checksum utility."
%%      }
%% =====================================================================
%
% \@bibitem and \@lbibitem definitions extracted from latex.tex
% labelled ``LATEX VERSION 2.09 <24 May 1989>''.  We add only the
% \@showtag invocations.
%
\def\@bibitem#1{\item\if@filesw \immediate\write\@auxout
    {\string\bibcite{#1}{\the\c@enumi}}\fi\ignorespaces
     \@showtag{#1}}
%
\def\@lbibitem[#1]#2{\item[\@biblabel{#1}]\if@filesw
      { \def\protect##1{\string ##1\space}\immediate
        \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces
     \@showtag{#2}}
%
% Here are the macros that actually set the tag.  By default, we put it
% in boldface type in a framed box that is right-adjusted in exactly the
% width of the current line (and we handle both the one- and two-column
% cases), and we ensure that a page break does not occur between the
% tag-in-the-box and its bibliographic entry.  For flexibility, the user
% may redefine \thecitetag to change the format.
%
\newcommand{\thecitetag}[1]{\fbox{\bf #1}}
%
\def\@showtag#1{
    \@tempdima=\textwidth
    \if@twocolumn
        \advance\@tempdima by -\columnsep
        \divide\@tempdima by 2
    \fi
    \hbox to \@tempdima{\hfill\thecitetag{#1}}\nobreak}

